package gbench.sandbox.matrix.ml;

import java.util.*;
import java.util.function.Function;

import org.junit.jupiter.api.Test;

import gbench.common.tree.LittleTree.IRecord;
import static gbench.common.tree.LittleTree.*;
import static gbench.common.tree.LittleTree.IRecord.*;
import static gbench.common.tree.LittleTree.Tuple2.*;
import gbench.commonApp.data.DataMatrixApp;
import static gbench.common.fs.XlsFile.DColumn.*;

public class JunitHyposis extends DataMatrixApp{
    
    @Test
    public void foo() {
        var col = COL(DBLS(100));
        println(col);
        var mm = col.groupBy(e->e>0.8,IRecord::REC).aovs((List<?> e)->e.size());
        println(mm);
        
        var aa = Arrays.asList(0d,0.1,0.2,0.3,0.4,0.5,0.6,0.7);// 分组信息
        println(aa);
        var ff = L2REC(aa).tuple2Stream().collect(llclc(e->
            TUP2((Double)(e._1()._2()),(Double)(e._2()._2())))).stream()
            .map(tup->(Function<Double,Boolean>)(x->x>=tup._1() && x<tup._2())) // 生成模式函数
            .collect(llclc(e->e));
        
        var xx = col.groupBy(d->ff.stream().map(f->f.apply(d)).takeWhile(e->e!=true).count()+"");
        println(rec(xx).aov2rec((List<?> ll)->ll.size()).toString2());
    }
    
   

}
